<template>
	<view @touchmove.prevent>
		<popup-active :visible.sync="activeShow" :popScreenList="popData" @toPage="toPage"></popup-active>
		<popup-special :visible.sync="specialShow" :popData="popData" @toPage="toPage"></popup-special>
		<popup-birthday :visible.sync="birthdayShow" :popData="popData" @toPage="toPage"></popup-birthday>
		<popup-draw :visible.sync="drawShow" :popData="popData" @toPage="toPage"></popup-draw>
		<popup-holiday :visible.sync="holidayShow" :popData="popData" @toPage="toPage"></popup-holiday>
		<popup-question :visible.sync="questionShow" :popData="popData" @toPage="toPage"></popup-question>
	</view>
</template>

<script>
import popupActive from '@/components/popup-activity/popup-activity.vue';
import popupSpecial from '@/components/popup-activity/popup-special.vue';
import popupBirthday from '@/components/popup-activity/popup-birthday.vue';
import popupDraw from '@/components/popup-activity/popup-draw.vue';
import popupHoliday from '@/components/popup-activity/popup-holiday.vue';
import popupQuestion from '@/components/popup-activity/popup-question.vue';
export default {
	props: {
		type: { type: String, default: '' },
		popData: { type: [Object, Array] }
	},
	data() {
		return {
			activeShow: false,
			specialShow: false,
			birthdayShow: false,
			drawShow: false,
			holidayShow: false,
			questionShow: false
		};
	},
	watch: {
		type: {
			handler(val) {
				this.activeShow = false;
				this.specialShow = false;
				this.birthdayShow = false;
				this.drawShow = false;
				this.holidayShow = false;
				this.questionShow = false;
				if (val) {
					this[`${val}Show`] = true;
				}
			},
			immediate: true
		}
	},
	components: {
		popupActive,
		popupBirthday,
		popupDraw,
		popupHoliday,
		popupQuestion,
		popupSpecial
	},
	methods: {
		toPage(path, type) {
			this.$emit('toPage', path, type)
		}
	}
};
</script>

<style></style>
